<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>材料供货商查询统计</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../resources/css/style.css" media="all">
		<style>
			.layui-input-inline {
				width: 80%;
			}
			/*.layui-form-item .layui-input-inline{width: 165px;}*/
			
			.masksx .forms {
				padding-left: 0;
				text-align: center;
			}
			
			.masksx {
				width: 600px;
				height: 50%;
			}
			
			.mask input {
				width: 100%!important;
			}
			
			.mask .layui-select-title {
				width: 550px;
			}
			
			.layui-inline {
				margin-bottom: 10px;
			}
			
			.layui-upload {
				text-align: left;
			}
			
			#demo2 img {
				width: 120px;
				height: 120px;
			}
			
			.imgs {
				position: relative;
				width: 120px;
				height: 120px;
				float: left;
			}
			
			._ingshan {
				position: absolute;
				right: 0px;
				top: 0px;
				border: 1px solid #E3e3e3;
				border-radius: 50%;
				width: 20px;
				height: 20px;
				text-align: center;
			}
			
			@media only screen and (min-width: 321px) and (max-width: 1024px) {
				.layui-form-pane .layui-input-inline {
					width: 100%;
				}
				._inkong {
					width: auto!important;
				}
				.layui-form-item .layui-input-inline {
					width: 100%;
				}
				.masksx {
					height: 50%;
				}
			}
			
			.layui-form-label {
				padding-left: 0;
				height: 20px;
			}
			.material-mask-top li{
				text-align: left;
				padding: 10px;
				list-style: none;
			}
		
			.mask .num{
				width: 30px !important;
			}
			.rm_Code,.eppName,.compName1{
				padding-left: 20px;
			}
		</style>
	</head>

	<body>
	<a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>
		<form class="layui-form layui-form-pane" action="">
			<div class="formTop" style="font-size:12px;">
				<div class="layui-form-item layui-col-lg2 layui-col-sm3">
					<div class="layui-input-inline">
						<input type="text" name="username" lay-verify="required" placeholder="请输入项目名称" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline layui-col-lg2 layui-col-sm3">
					<div class="layui-input-inline">
						<input type="text" class="layui-input" id="test-limit3" placeholder="请选择开始日期">
						<div class="icons">

						</div>
					</div>
				</div>
				<div class="layui-inline layui-col-lg2 layui-col-sm3">

					<div class="layui-input-inline">
						<input type="text" class="layui-input" id="test-limit4" placeholder="请选择结束日期">
						<div class="icons">

						</div>
					</div>
				</div>

				<div class="layui-col-lg2 layui-col-sm2">
					<button class="layui-btn" type="button" onclick="query()">查询</button>

				</div>

			</div>

			<table id="demo" lay-filter="test"></table>

			<script type="text/html" id="barDemo">
				
				<a class="layui-btn layui-btn-sm chakan quanxian" lay-event="detail" qx="api/supply/suppTotald.do">详情</a>
			</script>
		</form>


		<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
		<script src="../../../resources/js/style.js"></script>
		<script src="../../../resources/js/api.js"></script>
		<script type="text/javascript">
			function query() {
				layui.use(['form', 'layedit', 'laydate', 'table', 'element'], function() {
					var form = layui.form,
						table = layui.table;
					var pronName = $("[name='username']").val();
					var begintime = $('#test-limit3').val();
					var endtime = $('#test-limit4').val();
					
					if(!AntiSqlValid(pronName)) {
                        if(lbq('api/supply/suppTotald.do')) {
                            API.cailiaogonghuoshangchaxun({
                                'type': 'a',
                                'proName': pronName,
                                'begintime': begintime,
                                'endtime': endtime,
                                'p': getCookie('yanzheng')
                            })
                        }
					} else {
						layer.msg('请勿输入特殊符号或敏感文字');
					};
				})

			}
			layui.use(['form', 'layedit', 'laydate', 'table'], function() {
				var form = layui.form,
					layer = layui.layer,
					layedit = layui.layedit,
					table = layui.table,
					laydate = layui.laydate;
                jiazais();

				//前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
				panduanshijiantow('#test-limit3', '#test-limit4', 1000, 1000, '.layui-btn-normal'); //查询 开始结束时间判断
				if(lbq('api/supply/suppTotald.do')){
                    API.cailiaogonghuoshangchaxun({"type":"a",'p':getCookie('yanzheng')});
                }

                dayintishi('.dayin');

                laydate.render({
					elem: '#date'
				});
				var ccuid = '';
				//监听工具条
				table.on('tool(test)', function(obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
					var data = obj.data; //获得当前行数据
					var layEvent = obj.event; //获得 lay-event 对应的值
					var tr = obj.tr; //获得当前行 tr 的DOM对象

					if(layEvent === 'detail') { //查看
						//console.log(obj.data)
						sessionStorage.ccuid = obj.data.compid;
						window.location.href = 'cailiaogonghuoshangDetails.html';
					} 
				});

		

			})
		</script>

	</body>

</html>